<template>
    <div class="app-container">
        <div class="Top-title">计量详情</div>
        <div class="Decorative-line"></div>
        <div class="product-type">
            <div class="title">
                产品类型：
            </div>
            <div class="Type-box" :class="isactive == index ? 'Select' : '' " @click="OnClickProductType(index)" v-for="(item,index) in productTypeList" :key="index">
                {{item}}
            </div>
        </div>
        <el-tabs v-model="classification" class="classification"  @tab-click="handleClick">
            <!-- 部门 -->
            <el-tab-pane style="font-size:12px;" label="部门" name="department">
                <div class="product-type">
                    <div class="title">
                        计费时间：
                    </div>
                    <div>
                        <el-date-picker
                            style="26px"
                            @change="SimeSlotChange"
                            v-model="TimeSlot"
                            type="daterange"
                            format="yyyy 年 MM 月 dd 日"
                            value-format="yyyy-MM-dd"
                            range-separator="至"
                            start-placeholder="开始日期"
                            end-placeholder="结束日期">
                        </el-date-picker>
                    </div>
                    <div class="title" style="margin-left:20px">
                        云服务商：
                    </div>
                    <div>
                        <el-select v-model="queryParams.CloudService" placeholder="请选择">
                            <el-option
                            v-for="item in CloudServiceProviders"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                            </el-option>
                        </el-select>
                    </div>
                </div>
                <div class="TotalCost">
                    <div class="DecorationPoint"></div>
                    总费用
                </div>
                <div class="CostDescription">
                    {{queryParams.startTime}}   到   {{queryParams.endTime}} 计费为
                </div>
                <div class="TotalNumber">
                    未产生计费(计量)数据
                </div>
                <div class="TotalCost">
                    <div class="DecorationPoint"></div>
                    计费明细
                </div>
                <el-table
                    :data="DepartmentTablDeData"
                    stripe
                    style="width: 100%;font-size : 12px">
                    <el-table-column
                        prop="date"
                        label="部门"
                    />
                    <el-table-column
                        prop="date"
                        label="系统数量"
                    />
                    <el-table-column
                        prop="date"
                        label="云主机数量"
                    />
                    <el-table-column
                        prop="date"
                        label="vCPU总核数（核）"
                    />
                    <el-table-column
                        prop="date"
                        label="内存总大小（GB）"
                    />
                    <el-table-column
                        prop="date"
                        label="存储总大小（TB）"
                    />
                    <el-table-column
                        prop="date"
                        label="费用（元）"
                    />
                </el-table>
            </el-tab-pane>
            <!-- 系统 -->
            <el-tab-pane style="font-size:12px;" label="系统" name="system">
                <div class="product-type">
                    <div class="title">
                        计费时间：
                    </div>
                    <div>
                        <el-date-picker
                            style="26px"
                            @change="SimeSlotChange"
                            v-model="TimeSlot"
                            type="daterange"
                            format="yyyy 年 MM 月 dd 日"
                            value-format="yyyy-MM-dd"
                            range-separator="至"
                            start-placeholder="开始日期"
                            end-placeholder="结束日期">
                        </el-date-picker>
                    </div>
                    <div class="title" style="margin-left:20px">
                        云服务商：
                    </div>
                    <div>
                        <el-select v-model="queryParams.CloudService" placeholder="请选择">
                            <el-option
                            v-for="item in CloudServiceProviders"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                            </el-option>
                        </el-select>
                    </div>
                </div>
                <div class="TotalCost">
                    <div class="DecorationPoint"></div>
                    总费用
                </div>
                <div class="CostDescription">
                    {{queryParams.startTime}}   到   {{queryParams.endTime}} 计费为
                </div>
                <div class="TotalNumber">
                    未产生计费(计量)数据
                </div>
                <div class="TotalCost">
                    <div class="DecorationPoint"></div>
                    计费明细
                </div>
                <el-table
                    :data="DepartmentTablDeData"
                    stripe
                    style="width: 100%;font-size : 12px">
                    <el-table-column
                        prop="date"
                        label="系统"
                    />
                    <el-table-column
                        prop="date"
                        label="云主机数量"
                    />
                    <el-table-column
                        prop="date"
                        label="vCPU总核数（核）"
                    />
                    <el-table-column
                        prop="date"
                        label="内存总大小（GB）"
                    />
                    <el-table-column
                        prop="date"
                        label="分布式存储（TB）"
                    />
                    <el-table-column
                        prop="date"
                        label="FC通用存储（TB）"
                    />
                    <el-table-column
                        prop="date"
                        label="FC高性能存储（TB）"
                    />
                    <el-table-column
                        prop="date"
                        label="视频云存储（TB）"
                    />
                    <el-table-column
                        prop="date"
                        label="费用（元）"
                    />
                </el-table>
            </el-tab-pane>
            <!-- 云主机 -->
            <el-tab-pane style="font-size:12px;" label="云主机" name="CloudHost">
                <div class="product-type">
                    <div class="title">
                        计费时间：
                    </div>
                    <div>
                        <el-date-picker
                            style="26px"
                            @change="SimeSlotChange"
                            v-model="TimeSlot"
                            type="daterange"
                            format="yyyy 年 MM 月 dd 日"
                            value-format="yyyy-MM-dd"
                            range-separator="至"
                            start-placeholder="开始日期"
                            end-placeholder="结束日期">
                        </el-date-picker>
                    </div>
                    <div class="title" style="margin-left:20px">
                        云服务商：
                    </div>
                    <div>
                        <el-select v-model="queryParams.CloudService" placeholder="请选择">
                            <el-option
                            v-for="item in CloudServiceProviders"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                            </el-option>
                        </el-select>
                    </div>
                </div>
                <div class="TotalCost">
                    <div class="DecorationPoint"></div>
                    总费用
                </div>
                <div class="CostDescription">
                    {{queryParams.startTime}}   到   {{queryParams.endTime}} 计费为
                </div>
                <div class="TotalNumber">
                    未产生计费(计量)数据
                </div>
                <div class="TotalCost">
                    <div class="DecorationPoint"></div>
                    计费明细
                </div>
                <el-table
                    :data="DepartmentTablDeData"
                    stripe
                    style="width: 100%;font-size : 12px">
                    <el-table-column
                        prop="date"
                        label="云主机名称"
                    />
                    <el-table-column
                        prop="date"
                        label="云主机IP"
                    />
                    <el-table-column
                        prop="date"
                        label="vCPU（核）"
                    />
                    <el-table-column
                        prop="date"
                        label="内存（GB）"
                    />
                    <el-table-column
                        prop="date"
                        label="分布式存储（TB）"
                    />
                    <el-table-column
                        prop="date"
                        label="FC通用存储（TB）"
                    />
                    <el-table-column
                        prop="date"
                        label="FC高性能存储（TB）"
                    />
                    <el-table-column
                        prop="date"
                        label="视频云存储（TB）"
                    />
                    <el-table-column
                        prop="date"
                        label="CPU平均使用率（%）"
                    />
                    <el-table-column
                        prop="date"
                        label="内存平均使用率（%）"
                    />
                    <el-table-column
                        prop="date"
                        label="存储平均使用率（%）"
                    />
                    <el-table-column
                        prop="date"
                        label="费用（元）"
                    />
                </el-table>
            </el-tab-pane>
        </el-tabs>
    </div>
</template>
<script>
export default {
    data(){
        return{
            productTypeList:[
                '宿主机',
                '高性能',
                '云服务器',
                '存储产品',
                '安全产品',
                '操作系统',
                '数据库',
                '光纤链路',
                '备份服务',
                '计算高性能',
                '设备托管'
            ],
            CloudServiceProviders:[
                {
                    value: 'LangSao',
                    label: '浪潮云'
                },
                {
                    value: 'SuGa',
                    label: '曙光'
                },
                {
                    value: 'H3C',
                    label: '华三'
                }
            ],
            isactive :false,
            classification : 'department',
            // 筛选时间段
            TimeSlot: [],
            // 查询字段
            queryParams: {
                pageNum: 1,
                pageSize: 10,
                deptId : null,
                CloudService : '',
                startTime : '',
                endTime : '',
            },
            // 第一级部门表格数据
            DepartmentTablDeData : []
        }
    },
    created(){
        // 默认选中第一个产品类型
        this.OnClickProductType(-1)
    },
    methods:{
        // 点击选中产品类型
        OnClickProductType(index){
            if(this.isactive == index){
                return
            }
            this.isactive = index
            this.classification = 'department'
        },
        handleClick(val){
        },
        // 时间段选值赋值
        SimeSlotChange(val){
            if(val){
                this.queryParams.startTime = val[0]
                this.queryParams.endTime = val[1]
            }else{
                this.queryParams.startTime = null
                this.queryParams.endTime = null
            }
        },
    }
}
</script>
<style lang="scss">
    .app-container{
        .Top-title {
            text-align: left;
            margin-bottom: 20px;
            font-size: 14px;
            font-weight: bold;
            padding-left: 4px;
            border-left: 4px solid #38b3aa;
        }
        /* 装饰线 */
        .Decorative-line{
            width: 100%;
            height: 1px;
            background: #ccc;
            margin-top: 8px;
            margin-bottom: 8px;
        }
        /* 产品类型 */
        .product-type{
            width: 100%;
            height: 26px;
            margin: 4px 0;
            display: flex;
            .title{
                font-size: 12px;
                width: 80px;
                line-height: 26px;
                color: #999;
            }
        }
        .Type-box{
            width: auto;
            height: 26px;
            line-height: 26px;
            font-size: 12px;
            padding: 0 20px;
            background-color: #fff;
            border: 1px solid #999;
            margin-right: 6px;
        }
        .Select{
            background-color: rgb(48,65,86);
            color: #fff;
        }
        .classification{
            margin-top: 10px;
            font-size: 12px;
            /* 产品类型 */
            .product-type{
                width: 100%;
                height: 26px;
                margin: 4px 0;
                display: flex;
                .title{
                    font-size: 12px;
                    width: 60px;
                    line-height: 26px;
                    color: #999;
                }
            }
            // 总费用
            .TotalCost{
                width: 100%;
                margin: 4px 0;
                height: 20px;
                display: flex;
                color: skyblue;
                font-size: 14px;
                font-weight: bold;
                .DecorationPoint{
                    width: 6px;
                    height: 6px;
                    background-color:salmon;
                    border-radius: 50%;
                    margin-top: 6px;
                    margin-right: 12px;
                }
            }
            // 费用描述
            .CostDescription{
                width: 100%;
                height: 18px;
                line-height: 18px;
                color: #999;
                font-size: 12px;
                margin-left: 20px;
            }
            // 总金额计费和总计量统计
            .TotalNumber{
                width: 100%;
                height: 60px;
                line-height: 60px;
                margin-left: 20px;
                color: cornflowerblue;
                font-size: 20px;
                font-weight: bold;
            }
        }
    }
</style>
